<template>
  <div class="model-container">
    <div class="listName">
      系统账户管理
    </div>
    <!--搜索-->
    <el-card shadow="never">
      <div slot="header" class="clearfix">
        <span>快捷搜索</span>
        <div class="btns-wrapper-right">
          <el-button v-if="!show3" icon="el-icon-arrow-down" @click="show3 = true"></el-button>
          <el-button v-else icon="el-icon-arrow-up" @click="show3 = false"></el-button>
        </div>
      </div>
      <el-collapse-transition>
        <div class="cardbody" v-show="show3">
          <el-row :gutter="10">
            <el-col :xl="5" :lg="6" :md="6" :sm="8" >
              <el-col :xl="7" :lg="7" :md="8" :sm="8" class="input-name">用户名</el-col>
              <el-col :xl="17" :lg="17" :md="16" :sm="16">
                <el-input placeholder="请输入用户名"/>
              </el-col>
            </el-col>
          </el-row>
          <div class="cardfooter">
            <el-button type="primary" size="mini" plain @click="seachFun">查询</el-button>
            <el-button type="warning" size="mini" plain @click="resetFun">重置</el-button>
          </div>
        </div>
      </el-collapse-transition>
    </el-card>
    <!--表格-->
    <el-card style="margin-top: 10px">
      <div slot="header" class="clearfix">
        <div class="btns-wrapper-left">
          <el-button type="primary" plain @click="add">新增</el-button>
          <el-button type="danger" plain @click="add">删除</el-button>
        </div>
      </div>
      <div class="table-wrapper">
        <el-table v-loading="!dataOption" :stripe="true" :data="dataOption" empty-text="暂无数据" style="width: 100%">

          <el-table-column type="selection" width="55"/>

          <el-table-column prop="name" label="用户名"/>

          <el-table-column prop="name" label="电话"/>

          <el-table-column prop="name" label="备注"/>

          <el-table-column prop="name" label="注册时间"/>

          <el-table-column label="上次登录时间">
            <template slot-scope="scope">{{ scope.row.date }}</template>
          </el-table-column>

          <el-table-column prop="name" label="账号状态"/>

          <el-table-column label="操作" width="200px">
            <template slot-scope="scope">

              <el-button type="primary" icon="el-icon-edit" circle class="table-icon" @click="edit(scope.row)"/>

              <el-popover
                placement="top"
                width="160">
                <p style="margin-bottom:10px;font-weight:700;">确认删除吗？</p>
                <div style="text-align: right; margin: 0">
                  <el-button size="mini" type="text" @click="scope.row.delState = false">取消</el-button>
                  <el-button type="primary" size="mini" >确定</el-button>
                </div>
                <el-button slot="reference" type="warning" circle icon="el-icon-delete" class="table-icon popver-btn"/>
              </el-popover>
            </template>
          </el-table-column>

        </el-table>

        <!--分页-->
        <el-pagination
          :current-page="pageNo"
          :page-sizes="[10, 20, 30]"
          :page-size="pageSize"
          :total="100"
          background
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange">
        </el-pagination>
      </div>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      show3: false,
      pageNo: 1,
      pageSize: 10,
      // rowCount: new Number(), // 总条数
      dataOption: [{
        date: '2016-05-03',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }]
      // dataOption: null, //表格数据
    }
  },
  methods: {
    // 新增
    add() {

    },
    // 查询
    seachFun() {

    },
    // 重置
    resetFun() {

    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    }
  }
}
</script>
<style type="text/scss" lang="scss" scoped>

</style>
